import socket

client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

client.connect(('127.0.0.1', 8888))  # connect 参数是一个元组

client.send('hello'.encode())

data = client.recv(1024)
print('客户端收到数据：', data.decode())

client.close()
